package com.augrain.demo.controller.controllerAdvice;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.util.HashMap;
import java.util.Map;

/**
 * ModelAttribute
 *
 * @author biaoy
 * @date 2021/8/8
 */
@ControllerAdvice
public class ModelAttributeTest {

    @ModelAttribute(name = "md")
    public Map<String, Object> getData() {
        Map<String, Object> map = new HashMap<>();
        map.put("age", 30);
        map.put("gender", "male");
        return map;
    }
}
